package org.lcx.pipeline;

import org.lcx.pipeline.bean.PipelineExeption;
import org.lcx.pipeline.bean.PipelineResult;

/**
 * Pipeline中的Processor接口定义
 */
public interface Processor {
	// 终止执行,并回滚事务
	public int STOP_CHAIN_EXECUTION_AND_ROLLBACK = -1;
	// 终止执行,并提交事务
	public int STOP_CHAIN_EXECUTION_AND_COMMIT = 0;

	/**
	 * 具体业务逻辑处理方法
	 * 
	 * @param obj
	 * @param pipeResult
	 * @return
	 * @throws Exception
	 */
	public int runProcess(Object obj, PipelineResult pipeResult) throws PipelineExeption;
}
